﻿// -----------------------------------------------------------------------
// <copyright file="SingleStrategy.cs" company="Hewlett-Packard">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Ex3.FriendSelector
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using FacebookWrapper.ObjectModel;

    /// <summary>
    /// Returns the single strategy
    /// </summary>
    public class SingleStrategy : IStrategy
    {
        private bool m_IsSingle;

        public SingleStrategy(bool i_IsSingle)
        {
            this.m_IsSingle = i_IsSingle;
        }

        public bool IsFriendWanted(User i_friend)
        {
            if (i_friend.RelationshipStatus == null)
            {
                return false;
            }
            else
            {
                if (m_IsSingle)
                {
                    return i_friend.RelationshipStatus.Value == User.eRelationshipStatus.Single;
                }
                else
                {
                    return i_friend.RelationshipStatus.Value != User.eRelationshipStatus.Single;
                }
            }
        }
    }
}
